package bsc.war.handler;


import bsc.ejb.entity.Person;
import bsc.ejb.entity.ScoreView;
import bsc.war.delegate.DelegateBSC;
import bsc.war.factory.Factory;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

/**
 *
 * @author memozac
 */
public class AddScoreDomain extends AbstractController  {

     @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request,
         HttpServletResponse response) throws Exception {
        
        try {
            DelegateBSC delegate = (DelegateBSC) Factory.getBean("DelegateBSC");

            List<Person> persons = delegate.findPerson();
            List<ScoreView> scoreViews = delegate.findScoreView();

            request.setAttribute("persons", persons);
            request.setAttribute("scoreViews", scoreViews);

        } catch (Exception e) {
        }
         
         return new ModelAndView("addScoreDomain");
    }

}
